import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:led_wall_simulator/screen_controller.dart';

class ScreenPage extends StatelessWidget {
  const ScreenPage({super.key});

  @override
  Widget build(BuildContext context) {
    final ScreenController c = Get.put(ScreenController());

    return Scaffold(
      appBar: null,
      body: Obx(
        () => Transform(
          alignment: Alignment.center,
          transform: Matrix4.identity()
            ..scale(
              1.0,
              -1.0,
              1.0,
            ), // 这里进行了翻转操作
          child: GridView.count(
            primary: false,
            padding: const EdgeInsets.all(0),
            crossAxisCount: 16,
            mainAxisSpacing: 1,
            crossAxisSpacing: 1,
            children: c.screenLeds.toList(),
          ),
        ),
      ),
      // floatingActionButton: FloatingActionButton(onPressed: c.add),
    );
  }
}
